# packages install stage
FROM python:3.10-slim AS base

COPY sources.list /etc/apt/sources.list

RUN apt-get update \
    && apt-get install -y --no-install-recommends gcc g++ python3-dev libc-dev libffi-dev

RUN pip3 install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn

# COPY requirements.txt /requirements.txt
# RUN pip install --prefix=/pkg -r requirements.txt

RUN pip install requests==2.31.0
RUN pip install beautifulsoup4==4.12.2
RUN pip install langchain==0.0.352
RUN pip install transformers==4.25.1

# for milvus client sdk
RUN pip install grpcio==1.37.1
RUN pip install grpcio-tools==1.37.1
RUN pip install pymilvus==2.3.0

# COPY entrypoint.sh /entrypoint.sh
# RUN chmod +x /entrypoint.sh

VOLUME [ "/app" ]

ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"]

RUN echo "*****bp/langchain*******"

# cd docker-langchain
# docker build -t bp/langchain:0.0.2 .
# docker run --net host -v ./app:/app bp/langchain:0.0.2

